package com.MonkWorks.timedormitoryDB;

import java.util.HashMap;

import com.MonkWorks.clockDTO.User;

/**
 * 
 * @author ckattick This persist new users, and segregates type
 */

public interface IUserDB {
	/**
	 * 
	 * @param Username
	 * @param Password
	 * @return true if valid user
	 * @throws Exception
	 */
	public boolean Logon(String Username, String Password) throws Exception;

	/**
	 * Fetches user
	 * 
	 * @param username
	 * @returns user object including type
	 * @throws Exception
	 */
	public User fetchUser(String username) throws Exception;

	// TODO up for possible deletion

	/**
	 * 
	 * @param user
	 *            saves user object
	 * @return
	 * @throws Exception
	 */
	public void saveUser(User user) throws Exception;

	/**
	 * Return all users as a Hashtable.
	 * 
	 * @return a collection of all users.
	 */
	public HashMap<String, User> fetchAll();

}